<template>
  <div>
    <h2>响应式数据---ref和reactive和toRefs</h2>
    <p>{{data.str}}</p>
    <p>{{data.person.name}}</p>
    <p>昨天的作业</p>
  </div>
</template>

<script setup lang="ts">
import { reactive,toRefs } from 'vue';
let data = reactive({
  str:'hello',
  msg:"好好学习，天天向上",
  person:{
    name:"张三",
    age:20,
    sex:"男"
  }
})
let {str,msg,person}=toRefs(data)
</script>

<style scoped>

</style>